Software implementation installer mechanism

ABSTRACT

A method and mechanism for automatically installing software implementations such as applications and COM classes as they are needed from an external source. When a software implementation is needed, the mechanism first looks to the local system (e.g., registry) for that software implementation, and if found, returns the information such as a local path needed to use the software implementation. If the implementation is not found, the mechanism looks to another source, such as a CD-ROM or a centralized class store of a network, to locate the needed implementation. When located, the implementation is downloaded and locally installed from the source, and a local path is returned in a manner that is essentially transparent to the user. Software implementations such as application products may be divided into features and components to improve on-demand installation thereof.

RELATED APPLICATIONS

This application is related to the following United States Patent applications, all of which are filed on the same day and assigned to the same assignee as the present application:

“Use of Relational Databases for Software Installation”—Ser. No. 09/158,125;

“System and Method for Repairing a Damaged Application”—Ser. No. 09/158,126;

“Method and System for Restoring a Computer to its Original State After an Unsuccessful Installation Attempt”—Ser. No. 09/158,124;

“A Method for Categorizing and Installing Selected Software Components”—Ser. No. 09/657,695;

“System and Method for Managing Locations of Software Components Via A Source List”—Ser. No. 09/157,974;

“Method for Optimizing the Installation of a Software product onto a Target Computer System”—Ser. No. 09/157,853;

“Software Installation and Validation Using Custom Actions”—Ser. No. 09/157,776;

“Internal Database Validation”—Ser. No. 09/157,828;

“Management of Non-persistent Data in a Persistent Database”—Ser. No. 09/157,883;

“Method and System for Advertising Applications”—Ser. No. 09/158,967;

“Method and System for On-Demand Installation of Software Implementations”—Ser. No. 09/158,022;

“Method and System for Assigning and Publishing Applications” Ser. No. 09/158,968; and

“Class Store Schema”—Ser. No. 09/158,023.

FIELD OF THE INVENTION

The invention relates generally to computer systems, and more particularly to an improved method and system for installing software implementations such as applications and components.

BACKGROUND OF THE INVENTION

In contemporary enterprises such as a corporation, one of the duties of a network administrator is to set up and maintain the corporation's computers so as to make employees more productive. Lost productivity at employees' computer desktops is a major cost for corporations, often resulting from user errors such as inadvertently removing some or all of a needed application or using an old application rather than an enterprise-specified one that is improved, secure and/or compatible with others. Similarly, lost productivity often results from user errors such as removing or modifying other software implementations such as system configuration files, dynamic link libraries (DLLs), application files and object classes (e.g., COM objects) in ways that render the computer or applications unworkable. Productivity is also lost when a desktop is too complex, such as when the desktop has too many non-essential applications and offerings thereon. At the same time, much of the expense of administering distributed personal computer networks is spent at the desktop, performing tasks such as fixing the settings or reinstalling implementations that the user has incorrectly or inadvertently modified.

At the same time, an enterprise wants certain personnel to have access to various software implementations such as applications, while wanting other applications to be available to certain users for access if needed. For example, a corporate enterprise may declare a policy specifying that everyone in the company should use a particular electronic mail program, while in addition, those in the research department should be able to load a particular spreadsheet application if needed.

However, to implement such policy decisions, administrators or the like generally need to physically visit each workstation to load (or unload) the specified programs and other software implementations, adjust various system configurations, and so forth. In addition to initially setting the computers, the administrators must hope (or regularly check) that the users do not change the settings, however users regularly make modifications, leading to lost productivity. The administrator also needs to revisit the workstations to install new versions of implementations.

Moreover, such policies cause problems when multiple users share the same computer, since a policy instituted for one user of that computer may not be compatible with the policy for another. As can be readily appreciated, installing software implementations in an enterprise is a complex task that does not fit in well with existing systems and methods. In addition, installation for non-network users may also be improved.

SUMMARY OF THE INVENTION

Briefly, the present invention provides a method and mechanism for automatically installing a software implementation on demand. When information corresponding to a software implementation is received via an interface (API), the method and mechanism determine from the information whether the software implementation is locally installed on the computer system. For example, the information may correspond to an application or object identifier, whereby the method and mechanism access the system registry or other database to determine the install state thereof. If the information indicates that the software implementation is not installed on the computer system, the method and mechanism install it from a source, such as a CD-ROM or network source. The registry or database may then be modified to indicate that the software implementation is installed. Path information or the like of the software implementation is then returned, such as to an operating system or application.

Software implementations include applications, identified by a GUID (Globally Unique Identifier), file extension or application category information, an object class, application feature, or component. In a network environment, software implementations may be automatically applied (assigned or published) to a policy recipient, such as a user at logon, and installed on an as-needed basis. A resulting feature of the present invention is that an administrator may assign or publish implementations in a single, central location.

Other benefits and advantages will become apparent from the following detailed description when taken in conjunction with the drawings, in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram representing a computer system into which the present invention may be incorporated;

FIG. 2 is a diagram representing how various containers including a class store container are hierarchically organized under a policy object associated with a directory container;

FIG. 3 is a block diagram generally representing a computer network into which the present invention may be incorporated;

FIG. 4 is a block diagram generally representing exemplary components for possible on-demand installation thereof in accordance with various aspects of the present invention;

FIG. 5 is a block diagram generally representing the processing of on-demand location and installation of applications for policy recipients;

FIG. 6 is a flow diagram generally representing the steps taken at user logon to advertise an assigned application;

FIG. 7 is a block diagram generally representing the installer mechanism handling on-demand installation in response to a request by the operating system or OLE in accordance with one aspect of the present invention;

FIG. 8 is a flow diagram generally representing the steps taken when a user activates an assigned application via a shortcut including possible on-demand installation thereof in accordance with one aspect of the present invention;

FIG. 9 is a flow diagram generally representing the steps taken when a user attempts to activate an application via a file extension associated therewith;

FIG. 10 is a flow diagram generally representing the steps taken by an installer mechanism to possibly install an application associated with a file extension in accordance with one aspect of the present invention;

FIG. 11 is a block diagram generally representing the installer mechanism handling on-demand installation in response to a request by an application in accordance with another aspect of the present invention;

FIG. 12 is a block diagram generally illustrating the components for installing software implementations in accordance with various aspects of the present invention;

FIG. 13 is a block diagram representing how an application package may be hierarchically organized into features, components and files;

FIG. 14 is a flow diagram generally representing the steps taken by an operating system when a software implementation needs to be installed in accordance with one aspect of the present invention; and

FIGS. 15A-15B comprise a flow diagram generally representing the steps taken by an application to request installation of an implementation needed thereby in accordance with another aspect of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT Exemplary Operating Environment

FIG. 1 and the following discussion are intended to provide a brief general description of a suitable computing environment in which the invention may be implemented. Although not required, the invention will be described in the general context of computer-executable instructions, such as program modules, being executed by a personal computer. Generally, program modules include routines, programs, objects, components, data structures and the like that perform particular tasks or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations, including hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers and the like. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.

With reference to FIG. 1, an exemplary system for implementing the invention includes a general purpose computing device in the form of a conventional personal computer 20 or the like, including a processing unit 21, a system memory 22, and a system bus 23 that couples various system components including the system memory to the processing unit 21. The system bus 23 may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. The system memory includes read-only memory (ROM) 24 and random access memory (RAM) 25. A basic input/output system 26 (BIOS), containing the basic routines that help to transfer information between elements within the personal computer 20, such as during start-up, is stored in ROM 24. The personal computer 20 may further include a hard disk drive 27 for reading from and writing to a hard disk, not shown, a magnetic disk drive 28 for reading from or writing to a removable magnetic disk 29, and an optical disk drive 30 for reading from or writing to a removable optical disk 31 such as a CD-ROM or other optical media. The hard disk drive 27, magnetic disk drive 28, and optical disk drive 30 are connected to the system bus 23 by a hard disk drive interface 32, a magnetic disk drive interface 33, and an optical drive interface 34, respectively. The drives and their associated computer-readable media provide non-volatile storage of computer readable instructions, data structures, program modules and other data for the personal computer 20. Although the exemplary environment described herein employs a hard disk, a removable magnetic disk 29 and a removable optical disk 31, it should be appreciated by those skilled in the art that other types of computer readable media which can store data that is accessible by a computer, such as magnetic cassettes, flash memory cards, digital video disks, Bernoulli cartridges, random access memories (RAMs), read-only memories (ROMs) and the like may also be used in the exemplary operating environment.

A number of program modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24 or RAM 25, including an operating system 35 (preferably Windows NT), one or more application programs 36, other program modules 37 and program data 38. A user may enter commands and information into the personal computer 20 through input devices such as a keyboard 40 and pointing device 42. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner or the like. These and other input devices are often connected to the processing unit 21 through a serial port interface 46 that is coupled to the system bus, but may be connected by other interfaces, such as a parallel port, game port or universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface, such as a video adapter 48. In addition to the monitor 47, personal computers typically include other peripheral output devices (not shown), such as speakers and printers.

The personal computer 20 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 49. The remote computer 49 may be another personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the personal computer 20, although only a memory storage device 50 has been illustrated in FIG. 1. The logical connections depicted in FIG. 1 include a local area network (LAN) 51 and a wide area network (WAN) 52. Such networking environments are commonplace in offices, enterprise-wide computer networks, Intranets and the Internet.

When used in a LAN networking environment, the personal computer 20 is connected to the local network 51 through a network interface or adapter 53. When used in a WAN networking environment, the personal computer 20 typically includes a modem 54 or other means for establishing communications over the wide area network 52, such as the Internet. The modem 54, which may be internal or external, is connected to the system bus 23 via the serial port interface 46. In a networked environment, program modules depicted relative to the personal computer 20, or portions thereof, may be stored in the remote memory storage device. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.

For purposes of the following description, a client workstation (e.g., 20 ₁) may correspond to the computer system 20, while software implementations 60 such as applications or pieces thereof, (e.g., products, features and components as described below), objects and so on may reside on one or more of the remote computers 49. However as can be readily appreciated, no particular arrangement of the various files, interfaces, objects (classes), mechanisms, processes and so on described herein is necessary to the present invention. Indeed, as is understood in computing and networking in general, such files, interfaces, objects, mechanisms, processes and so on may be combined, separated and/or distributed in virtually any number of ways among the various network devices.

Also, as will become apparent below, there is no requirement to limit on-demand installation to networks, as other implementations such as standalone users may benefit from the present invention. The on-demand installation of implementations may be performed by the present invention for any number of users in many types of environments, from a single standalone user to an enterprise-wide network of policy recipients, i.e., users and machines. Indeed, although a deployment scheme is able to trigger the installation mechanism remotely and efficiently, thus leveraging it for enterprise-wide deployment, it is understood that the concept of install on demand is valid outside the scope of application deployment. Notwithstanding, many aspects of the present invention will be described hereinafter with respect to network application deployment, since network application deployment benefits significantly from on-demand installation.

In one embodiment, the present invention provides a method and system that facilitates deploying software implementations by automatically installing the software implementations throughout a computer network in a highly flexible, scalable, extensible and efficient manner. To this end, as shown in FIG. 2, the method and system leverage a highly flexible architecture wherein an administrator can tailor policies 62 to containers 64 (sites, domains, and organizational units of users and computers arranged in a hierarchical manner), by specifying one or more policies 62 therefor, such that the policy within an organization is centrally managed. Such group policies 62, including the prioritizing of multiple policies for policy recipients (e.g., users or machines) are described in U.S. patent application Ser. No. 09/134,805, entitled “System and Method for Implementing Group Policy,” assigned to the assignee of the present invention and hereby incorporated by reference herein in its entirety.

Although not necessary to the present invention, group policies 62 are maintained via a Windows NT® 5.0 directory service, known as the Active Directory 66, ordinarily maintained in a domain controller 68 (FIG. 3). More particularly, each group policy object 62 comprises a group policy container in the directory service and a group policy template in the “sysvol” of the domain controller 68, but for purposes of simplicity are generically referred to herein as a group policy object. In general, the Active Directory 66 stores information about the objects of a domain, and makes this information easy for administrators to access, find and apply via a single, consistent and open set of interfaces. For example, with the Active Directory 66, administrators have a single point of administration for the objects on the network, which can be viewed in a hierarchical structure. A core unit in the Active Directory 66 is the domain, and the objects of a network exist within a domain. A single domain can span multiple physical locations or sites.

Thus, one aspect of the present invention is described herein with reference to the Microsoft® Windows NT® operating system, and in particular to the flexible hierarchical structure of sites, domains and/or organizational units of a Windows NT® Active Directory 66. Notwithstanding, there is no intention to limit the present invention to Windows NT® and/or the Active Directory architecture, or even to networks, but on the contrary, the present invention is intended to operate with and provide benefits with any operating system, architecture and/or mechanisms that install software implementations.

SOFTWARE IMPLEMENTATION INSTALLER METHOD AND MECHANISM

In general, a first aspect of the present invention involves the on-demand installation of applications for purposes of application deployment, i.e., initially making an application or some piece thereof available (e.g., core code) to network policy recipients via policies 62. As described in the copending United States Patent Applications entitled “Method and System for Assigning and Publishing Applications” and “Method and System for Advertising Applications,” assigned to the assignee of the present invention, filed concurrently herewith and hereby incorporated by reference herein in their entireties, to initially deploy an application, an administrator can choose to either “assign” or “publish” the application. To this end, as shown in FIGS. 2 and 3, one or more group policy objects (templates) 66 associated with users or machines of a directory container may be associated with policy recipients, and a subcontainer of each group policy object, deemed a class store, may include application deployment information. Note that although separately shown in FIG. 2 for purposes of simplicity, a class store 70 is actually a subcontainer of the group policy container, as described in more detail in co-pending United States Patent Application entitled “Class Store Schema,” assigned to the same assignee as the present invention, filed concurrently herewith and hereby incorporated by reference herein in its entirety.

Via this centrally maintained deployment information in the class store 70, policy recipients (e.g., users and workstations/machines) in a directory container 64 (e.g., organizational unit) are assigned applications, or applications are published thereto. An application typically is assigned to a group of users (or a group of machines) when it is deemed mandatory for that group to have that application, while published applications are those that are made optionally available to users who may benefit therefrom. For example, the same version of an electronic mail application program may be assigned to everyone in an organization, while a word processing program may be assigned to every group of users that needs some word processing capabilities. However, an application program for editing images may not be needed by everyone, and thus such a program may be published on a per-group basis so that those groups of users who may benefit from the program have it, while others who do not need it will not have it occupy resources of their workstations. Publishing is generally described below.

Assigned applications are advertised, i.e., they appear as available to a user at each logon (if assigned to a user) or at each re-boot (if assigned to a machine). Advertised applications are not necessarily installed on the workstation, but rather may only appear to be installed. To make an application appear installed, advertisements for an application include shortcuts that appear on the Start Menu, a collection of registry entries required primarily for OLE and shell activation, and icon files, (note that these concepts of advertising are valid for both network and standalone users). For example, to explicitly launch an application, users navigate the Start Menu looking for a shortcut representing the application, then click that shortcut. Thus, shortcuts placed on the Start Menu represent a blatant advertisement for an application. Users also implicitly launch applications by double-clicking a file (of a file system) having an extension associated with a particular application. Since associations between file extensions and applications are stored in the system registry 74 (FIG. 4), writing such associations to the registry 74 is another way in which the present invention may advertise applications. Other examples of how an application is advertised include writing class information (i.e., for OLE/COM activation), MIME associations and shell verbs.

Assigned applications are also resilient, in that they will be re-advertised on the next logon (or machine re-boot as appropriate) if deleted from the local workstation (machine) 20 ₁. For purposes of simplicity, assignment will hereinafter ordinarily be described with reference to being applied to users via a policy at user logon, although it is understood that policies may be applied to a machine when the machine connects to the network, e.g., at machine re-boot, and thus applications may be assigned to machines (e.g., via a machine profile 79) in the same general manner as users. Moreover, even if a user installs another program or different version of the application over an assigned application, because the advertise script is applied, the assigned application (the administrator-specified version) will return at the next logon. Only an administrator (and in particular a domain administrator) may permanently remove an assigned application, by doing so via the centralized location.

Another way in which applications are resilient, for example, is when the target of the shortcut has already been installed, but certain key files have been deleted. As described below and in the aforementioned patent application entitled “System and Method for Repairing a Damaged Application,” hereby incorporated by reference herein in its entirety, the application may cause the on-demand installation of the files, thereby repairing itself. Such resiliency applies to both network and standalone users, e.g., the application may repair itself from a network source or via a source such as a CD-ROM.

To assign an application, as generally shown in FIG. 4, the administrator, using an application deployment editor 78 or other suitable tool, selects an application package (e.g., 80). The application deployment editor 78 causes an advertise script 82 (a file) to be generated and stored for one or more groups of users (or machines) in a group policy template (object), e.g., 62 ₂, of the Active Directory 66. More particularly, to generate the advertise script 82, the application deployment editor 72 calls the MsiADvertiseProduct() API (application programming interface) of a managed software installer mechanism 84 a (named the “Windows installer” in one preferred implementation) with the information as set forth in the table below:

UINT  MsiAdvertiseProduct( LPCTSTR szPackagePath // Fully qualified path to a package LPCTSTR szScriptFilePath // If NULL, product is advertised locally LPCTSTR szTransforms // Semi-colon delimited list of transforms LANGID idLanguage // Language of product being advertised );

Upon successful completion, the result is the advertise script 82 containing records for creating advertisement information, e.g., including shortcuts, icon files, and OLE and shell activation registry entries. Note that in the network environment, szScriptFilePath may specify a file stored in the applications folder of the group policy object 66 ₂ as represented in FIG. 4. In general, the advertise script 82 comprises information corresponding to a series of commands, API calls, or the like, such as resulting in standard API calls to write various information to the registry 74 at certain keys, add application shortcuts to the Start Menu, and so on. For purposes of simplicity, the usage of well-documented APIs to write information to a registry and add shortcuts to menu folders will not be described herein in detail.

As shown in FIG. 2, packages such as the packages 80 are stored and cataloged under the class stores 70, and may be available from various vendors for different platforms, activation modes, access control, setup, and installation information. For example, the package 80 may include an entire application (e.g., Microsoft® Word or Excel), a set of binary component implementations packaged together, or a standalone COM (Component Object Model) component (e.g., an ActiveX™ control).

Once the advertise script 82 is generated and stored in the group policy template 62 ₂, a user having the group policy template 62 ₂ applied thereto (e.g., at logon) receives the advertise script 82 in their user profile 78. Logon code 86 then calls the managed software installer mechanism 84 b to process the advertise script 82, the result of which is the creation of a collection of advertisement information 88 including shortcuts on the Start Menu and registry entries required for shell and OLE activation. Advertisement information references the managed software installer mechanism 84 b, and, as described below, the operating system 35 knows what to do when it encounters such information. Lastly, in accordance with one aspect of the present invention and as described in detail below, the managed software installer mechanism 84 b is involved is when activation occurs, i.e., the managed software installer mechanism 84 b is called when an application is activated to install one or more components as needed to service the activation request.

In general, executing the advertising script 82 makes the application appear to be available to the user, including writing information to the system registry 74 and adding script information such as shortcuts to assigned programs to the user profile 78 (e.g., the Start Menu or desktop) on the workstation. FIG. 6 shows the steps taken by the logon process 86 at user logon, beginning at step 600 wherein as part of applying the group policy template 62 ₂ (and any other templates), the logon process 86 writes the advertising script 82 (and any other scripts) to the user profile 72 in the local workstation 20 ₁. At step 602, an advertise script is selected from the user profile. To resolve potential conflicts in accordance with policy settings, the selection may be in a prioritized order, (as described in the aforementioned “Group Policy” patent application). In any event, once selected, the installer mechanism 84 b is called at step 604 to process the script, e.g., populate the registry with information such as file-extension associations, write application shortcuts to the user's Start Menu or desktop and so on as represented by step 606. Step 608 repeats the processing of scripts (one of which will be the script 82) until there are no more to process.

More particularly, each of these advertise scripts associated with the directory containers 64 to which the user belongs are handed to the managed software installer mechanism 84 b for processing, via the MsiAdvertiseScript() API, as set forth in the table below:

UINT WINAPI MsiAdvertiseScript ( LPCTSTR szScriptFile, // path to script from MsiAdvertiseProduct DWORD dwFlags, // the SCRIPTFLAGS bit flags that control the script execution PHKEY phRegData,  // optional parent registry key BOOL fRemoveItems); // TRUE if specified items are to be removed

Possible bits for the “dwFlags” argument include:

Typedef enum tagSCRIPTFLAGS { SCRIPTFLAGS_CACHEINFO = 0x00000001L, // set if the icons need to be // created/ removed SCRIPTFLAGS_SHORTCUTS = 0x00000004L, // set if the shortcuts needs to // be created/ deleted SCRIPTFLAGS_MACHINEASSIGN = 0x00000008L, // set if product to be // assigned to machine SCRIPTFLAGS_REGDATA_APPINFO = 0x00000010L, // set if the app advt // registry data needs to be written/ removed SCRIPTFLAGS_REGDATA_CNFGINFO = 0x00000020L, // set if the product cnfg //mgmt. registry data needs to be written/ removed SCRIPTFLAGS_REGDATA = SCRIPTFLAGS_REGDATA_APPINFO | SCRIPTFLAGS_REGDATA_CNFGINFO, // for source level backward compatibility SCRIPTFLAGS_VALIDATE_TRANSFORMS_ LIST = 0x00000040L } SCRIPTFLAGS;

The MsiAdvertiseScript() serially executes the list of advertise script information 82 in accordance with the above parameters. Once successfully processed, an advertise script stores information in the user's profile and the system registry that is used to manage advertised applications. This set of per-user information includes attributes for each advertised product, source list information, feature-to-product associations, and descriptors for each advertised component. Note that the script need not necessarily store its data in the registry, but may alternatively store it elsewhere on the local workstation, and the operating system made aware of the location.

In accordance with one aspect of the present invention, assigned and published applications may be installed on the local workstation 20 ₁ on an as-needed basis (on demand) by the managed software installer mechanism 84 b. For example, the first time that a user activates such an application (e.g., via the Start Menu), the managed software installer mechanism 84 b looks for it on the local machine but does not find it, after which the managed software installer mechanism 84 b installs the application, such as via a software implementation 60 maintained in the class store 70 and/or via an application image 90 (FIG. 3) on a network server 92. Note that the network server 92 may be the same server 49 on which the application package 80 was loaded, which may or may not be the domain controller 68, however as can be appreciated, this is not necessary. Thereafter, the application remains on the local workstation 20 ₁ and need not be re-installed, unless deleted in some manner. However, even if deleted, the application will be re-advertised the next time policy is applied, e.g., at the next user logon, whereby if again activated, the application will again be re-installed. Note that if the application is installed but damaged, e.g., key files are deleted, the application may perform self-repair at this time. In this manner, assigned applications are automatically deployed in accordance with a policy, but for purposes of efficiency, initially may be only advertised rather than installed. Similarly, a standalone user may have programs advertised without taking up substantial storage on the user's machine. Thus, as can be readily appreciated, installing programs only if and when activated provides substantial benefits, including efficient use of workstation resources, rapid user-logon, and balancing of the load on the network servers.

To manage the advertised applications, the managed software installer mechanism 84 b uses the identifiers set forth in the following table:

{ProductCode} A standard GUID which uniquely identifies a product. FeatureID A string which represents a feature. A FeatureID should be human readable and need only be unique within a given product. {ComponentCode} A standard GUID which uniquely identifies a component. [Descriptor] A descriptor is comprised of a {ProductCode}, a FeatureID and a {ComponentCode} within square brackets, e.g., [{ProductCode}FeatureIDdelim- iter{ComponentCode}]. A delimiter exists between the FeatureID and the {ComponentCode} since a FeatureID is variable in length. Delimiter ASCII value 2, chosen so as to not collide with characters that might appear as part of a FeatureID

In certain cases “compressed” descriptors, which have a slightly different format, may be used. Products, features components and descriptors are described in more detail below with particular respect to FIG. 13. The per-user configuration manager information is stored below the registry key HKEY_CURRENT_USER\Software\Microsoft\Installer. General properties for each advertised product are stored under a Products key by {ProductCode}.

An association between the managed software installer mechanism 84 b and the operating system 35 (e.g., shell and essentially OLE) enables on-demand installation of software implementations. For example, as represented in FIG. 7, shell and OLE activation code (collectively 85), as well as many shell and OLE-related registry entries, are preferably installer mechanism-aware.

To this end, managed shortcuts include a descriptor (based on a shortcut, classID, file extension and so on) that the shell activation code (of the operating system 35) detects, and hands to the managed software installer mechanism 84 b, (to await resolution in the form of a path, which it may then process). Similarly, OLE activation is aware of such descriptors, and calls an API of the managed software installer mechanism 84 b to resolve them. Both of these operations are represented in FIG. 7 by the circled numeral one.

By way of a first example, FIG. 8 shows the general operation taken by the installer 84 b when a user attempts to activate an advertised application (e.g., 98) by clicking a shortcut corresponding thereto, beginning at step 800. At step 802, the operating system 35 communicates with the managed software installer mechanism 84 b to determine if the application 98 is locally installed, one of the possible states of an advertised application as described below. As represented by the circled numeral two in FIG. 7, the managed software installer mechanism 84 b looks to the system (i.e., the registry or similar database) to determine if the state is locally installed (or broken, for purposes of self-repair), and receives this state information as represented by the circled numeral three. At step 804 (FIG. 8), if the application 98 is not locally installed, the installer 84 b installs it (or at least some core portion thereof) at step 806, as also represented by the circled numeral four in FIG. 7, wherein the dashed line beside the circled numeral four indicates an optional operation, and as described in more detail below. Also, the state of the application 98 is changed to locally installed, so that the next time activation thereof is requested, installation is not necessary. Lastly, the managed software installer mechanism 84 b provides the operating system/OLE 35 with the information needed to execute the application (circled numeral five in FIG. 7), and at step 808 (FIG. 8) the operating system 35 executes the application. Note that except for possible installation delay times, in typical situations, the installation is essentially invisible to the requesting user. Of course, if the source cannot be located, e.g., the network is down or a CD-ROM source is not in the drive, the install may fail and/or the user may see a prompt requesting some user action. More particularly, see the aforementioned U.S. patent application entitled “System and Method for Managing Locations of Software Components Via a Source List.”

An administrator may also choose to publish an application, essentially to make the application available to a user if needed. Published applications are just as manageable as assigned applications, however unlike assigned applications, a published application has no presence on a user's machine until invoked. Thus, a published application has no attributes on the client machine, but rather has its attributes stored in the Active Directory 66. A published application can be located in the Active Directory in a number of ways, including via an application name, a class ID serviced by the application, a program ID serviced by the application, a file extension serviced by the application, and MIME type or content type serviced by the application.

To this end, each of the above attributes may be used as the key to locate a published application in the Active Directory 66. Then, once a published application is located, the application's user-friendly (human readable) name is available, as well as enough information to assign the application to the user. Thus, until needed, a published application is not installed, nor does it appear to the user to be installed. For example, there are no shortcuts present to use for activating the application. Instead, published applications may be activated by the above-attributes such as file extension, in a two-step process as described below with particular reference to FIGS. 9-10. First the operating system 35 shell (or similarly OLE) attempts to locate the application activation information in the local machine's registry 74. If the information is not found (as with a published application), an Active Directory 66 lookup occurs (as described in the aforementioned “Class Store Schema” patent application. This is alternatively shown by circled numerals one and two in FIG. 7. Note that the administrator may prioritize which application in the class stores handles which extension. If found, the application script is advertised as described above, i.e., the application is effectively assigned to the user, the registry is populated, the item added to the Start Menu, and so on as if the application was assigned. The process then launches the application. Conversely, if no associated application is found in the class stores 70, an appropriate error is returned (e.g., no association for this application for this user). Note that the user may be given a roaming profile, whereby such information roams with the user regardless of where the user logon takes place. If not, the information stays on the machine that triggered the assignment. In this manner, published applications as well as assigned applications essentially follow the user around. Once the application is assigned, activation continues as with normal assigned applications.

By way of another example of the on-demand installation of applications, both assigned and published applications may be activated by invoking (e.g., double-clicking) a file (document) having an extension with an associated application registered in the registry. FIGS. 9 and 10 show how such an action may lead to the file being installed if needed, beginning at step 900 which represents the double-clicking (or similar operation such as right-click, open) of the document. At step 902, the operating system shell 85 looks to the local registry 74 for file extension information, i.e., an application associated with the file extension. If the information is found, step 904 branches to step 906 which then calls the installer 84 b to locate the associated application and return a file system path thereto (FIG. 10) as described below. Note that the administrator may prioritize which application handles which extension since multiple applications may be capable of handling the same file type.

If not found in the local registry 74 at step 904, then an application corresponding to the extension has not been assigned, however an application corresponding to the extension may still be published to the requesting user. Published applications are just as manageable as assigned applications, however unlike assigned applications, a published application has no presence on a user's machine until invoked. Thus, a published application has no attributes on the client machine, but rather has its attributes stored in the Active Directory 66.

Note that a published application can be located in the Active Directory in a number of ways, including via an application name, a class ID serviced by the application, a program ID serviced by the application, a file extension serviced by the application, an interface identifier serviced by the application and MIME type or content type serviced by the application. To this end, each of the above attributes may be used as the key to locate a published application in the Active Directory 66. Then, once a published application is located, the application's user-friendly (human readable) name is available, as well as enough information to assign the application to the user. Thus, until needed, a published application is not installed, nor does it appear to the user to be installed. For example, there are no shortcuts present to use for activating the application.

Thus, when a possibly-published application is invoked, step 904 branches to step 910 to look for the extension information in the Active Directory 66, i.e., the class stores 70 associated with this user. To determine this, at step 910, the operating system calls an application management service 84 to find the appropriate script or scripts and look in the scripts for the file association. To this end, a class store manager 86 is called by the application management service 84 to query the class stores 70 for an appropriate application as described in the aforementioned “Class Store Schema” patent application. This is alternatively shown by circled numerals one and two in FIG. 7. Note that the administrator may similarly prioritize which application in the class stores handles which extension. If found, the application script is advertised at step 914 as described above, i.e., the application is effectively assigned to the user, the registry is populated, the item added to the Start Menu, and so on as if the application was assigned. The process then returns to step 902 so that the application may be launched. Conversely, if no associated application is found in the class stores 70 at step 912, an appropriate error is returned (e.g., no association for this application for this user) at step 916.

Note that if the directory lookup is successful, the return information is used to assign the application to the user's profile. As a result, the user may be given a roaming profile, whereby such information roams with the user regardless of where the user logon takes place. If not, the information stays on the machine that triggered the assignment. In this manner, published applications as well as assigned applications essentially follow the user around. Once the application is assigned, activation continues as with normal assigned applications.

To launch an application, managed shortcuts include a descriptor (based on a shortcut, classID, file extension and so on) that the shell activation code (of the operating system 35) detects, and hands to the managed software installer mechanism 84 b, (to await resolution in the form of a path, which it may then process). Similarly, OLE activation is aware of such descriptors, and calls an API of the managed software installer mechanism 84 b to resolve them.

FIG. 10 shows the steps taken by the installer 84 b to locate the application, and install it as needed. When the installer 84 b receives the extension information, (step 1000), the managed software installer mechanism 84 b determines if the application is locally installed at step 1002, one of the possible states of an advertised application. As represented by the circled numeral three in FIG. 7, the managed software installer mechanism 84 b looks to the system (i.e., the registry or similar database) to determine if the state is locally installed, and receives this state information as represented by the circled numeral four. If the application is not locally installed, the installer 84 b installs it, (e.g., into a program files folder 75, FIG. 5, of the file system), as shown by circled numeral five and at step 1004, (or at least some core portion of the application), as also described in the aforementioned copending United States Patent Application entitled “Method and System for On-Demand Installation of Software Implementations” hereby incorporated by reference herein in its entirety. Also, at step 1006, the state of the application is changed to installed, so that the next time activation thereof is requested, installation is not necessary.

As part of the process that returns the file system path, the installer 84 b also verifies that the application in question has been installed and/or has its key files intact, as represented by step 1008. If the application is not installed, or is determined to be damaged, the installer will install and/or repair the application by installing any needed files, as represented by steps 1010 and 1012.

Lastly, at step 1014, the installer returns the application path to the operating system. Regardless of whether previously installed or not, and assuming no other errors, security problems and so forth, the application is launched at step 908 (FIG. 9 and circled numeral six, FIG. 7), and the application appropriately opens the document.

Note that many file extensions are capable of being handled by multiple applications. The administrator or user may prioritize which applications open which files. To this end, each application sets forth the file extensions it is capable of handling, and this information is stored in the Active Directory 66. When a file extension is selected, a suitable mechanism may be employed to scan the application information in the Active Directory to locate those applications that handle that file type. Via a suitable user interface, the administrator may then determine which application association gets written into the registry for that file type, and also may rank the order of searching for a suitable application in the class store 70 to open the file in the event that the association is not found in the registry. The ability to recognize applications which service the same extension, and therefore the ability to prioritize them, stems largely from two features of the installer, i.e., the ability to create advertise scripts, and the fact that the extensions serviced by a given product can easily be read from .MSI packages.

In addition to installing applications, the managed software installer mechanism 84 b may install other software implementations such as an application's object classes 94 (FIG. 2). To this end, the class store 70 maintains the classes 94 (or the information needed to locate the classes on the network). When the operating system 35, OLE or the like receives a request for an object class, it first communicates with the managed software installer mechanism 84 b to determine if the object class is locally installed. If not found locally, the managed software installer mechanism 84 b looks for the object class in the class store 70. If found, the managed software installer mechanism 84 b installs the object class therefrom, instead of returning an error.

The managed software installer mechanism 84 b may also install software implementations based on information such as component categories 96. For example, a category to which an application belongs effectively may be “spreadsheet.” If the managed software installer mechanism 84 b receives a category request for a spreadsheet application, the mechanism 84 b may look to the component categories 96, also maintained in the class store 70, to determine if a spreadsheet application is published to the user, and if so, install that application.

In general, the managed software installer mechanism 84 b provides a standard installation mechanism for applications and components, i.e., it is an execution engine for the setup scripts generated by the application deployment editor 78 or other various authoring tools. In general, the package is what a developer uses an authoring tool to create, i.e., essentially when a developer “writes a setup,” the result is a Windows installer package. From that package, advertise scripts are created, and subsequently executed. However, it is also possible to install the package itself by generating and then running an install script. Generation and execution of install scripts are both handled on the end user's machine, in contrast to the advertising script model. For example, this happens in response to a standalone install, or as the result of install on demand.

As described in more detail below, the managed software installer mechanism 84 b also exposes an application programming interface (API) which an application program 98 may use (FIG. 11) to determine what installation choices users made, or even to install missing components. For example, if a component is missing, the application 98 itself may in effect run setup for the user, using installer APIs as set forth below to install the missing component. Moreover, because the managed software installer mechanism 84 b is a basic system service that tracks information about what is installed, it may provide administrators in managed environments with a powerful set of tools for determining the software installed, and remotely pushing software installation down to user machines.

FIG. 12 illustrates the managed software installer mechanism 84 b architecture as embodied in the Windows NT® operating system, wherein the installer consists of two executable components, a client install engine 100, which runs with user privileges 102, and an install service 104. Because the install service 96 is implemented as an NT Service, it may be run with elevated administrative privileges 106. Note that changes to the system configuration (e.g., changes to the registry 74 and file system 35) are done as an installation transaction 108 by the install service 104, and the rollback transactions 110 are logged to provide for rollback of a failed or aborted installation. The rollback includes restoring the original contents of files replaced or deleted during the installation and restoring overwritten or deleted registry settings (e.g., COM class registration). Note that since this rollback information 110 may take up a significant amount of space, it may be disabled by an administrator or a user when performing an installation. The client install engine 100 and the install service 104 communicate through secure remote procedure calls. Note that where everything is in the same process, (e.g., in Windows 95 or Windows98), secure RPC is not used.

Although not necessary to the present invention, to improve installation, the installer 84 b is arranged to divide applications into a three-level hierarchy, such as in the sample feature hierarchy shown in FIG. 13. At the top of the hierarchy is a product 112, which is an implementation that an administrator or end-user may install, e.g., a specific word processing application package such as Microsoft® Word. As further shown in FIG. 13, a product may be composed of multiple features such as the features 114 ₁-114 ₄, wherein a feature is the smallest installable unit of functionality. Examples of features of a word processor are a reader 114 ₁, Editor 114 ₂, Spellchecker 114 ₃, and Printer 114 n. A feature is something an administrator/user may choose to install or not, and thus somewhat corresponds to a checkbox in the “Custom” or “Advanced” installation dialog of a conventional installation mechanism.

Features in turn comprise one or more components such as 116 ₁-116 ₆, wherein a component is the smallest unit of sharing among products and features. For example, a component such as component1 116 ₁ may be shared by both the Reader feature 114 ₁ and the Editor feature 114 ₂. Only one copy of the corresponding file 118 ₁ (e.g., a DLL) is actually installed, but that copy is installed if either Feature1 or Feature2 is installed. Note that while FIG. 13 shows components composed of files 118 ₁-118 ₉, components are the actual contents of a product, and may be composed of files, registry entries, COM registration information, Visual Basic type libraries, shortcuts, (e.g. for the Windows Start menu), and so on.

While features are specific to a product and identified by a name unique only within the product (e.g. “Reader”), components are global across all products installed on a machine and are identified by a GUID. Note that although COM components are also uniquely identified by a GUID and may be encapsulated as an installer component, an installer component is not related to COM. An installer component 116 is monolithic, i.e. it is either entirely installed on a machine or not installed at all. Because installer component identifiers are global, they are shared across products.

By way of example, a number of products ship the Microsoft Visual Basic for Applications (VBA) runtime. Defining VBA as an installer component 116 provides advantages, including that the installation logic for VBA can be encapsulated within the component 116, so all products which install VBA will install and uninstall it in exactly the same way. Also, once VBA is installed on a machine, the managed software installer mechanism 84 knows that VBA is there, and installation of subsequent products which use this component simply increase an installation reference count of the component, i.e., the products share the same copies of the files. Moreover, since the managed software installer mechanism 84 manages the installed components, it operates properly when a product is uninstalled, i.e., the reference count ensures that the mechanism does not remove components shared by products remaining on the machine.

FIG. 14 shows how the operating system/OLE requests a full component path that may result in the on-demand installation of components and/or features as needed, such as by using the MsiProvideComponentFromDescriptor API set forth below. In general, a descriptor is a token representing a product code/feature name/component GUID. First, the operating system calls the API at step 1400, requesting a full component path. In turn, the API (via the MsiUseFeature API, described below) checks the local machine at step 1402 to detect that the components that make up that feature are installed. Note that the API only installs one feature, i.e., the one that was requested, however, if there are “ancestors” of that feature in the feature hierarchy defined in the package, those are also installed (if not already installed). In other words, a given feature may not be installed if its parent is not also installed. Likewise, when verifying that all of the components in the feature are valid, the components in all ancestor features are also verified. In any event, if not installed, step 1404 branches to step 1406, to install (via the MsiConfigureFeature API, also described below) the needed piece or pieces of the product. Lastly, step 1408 obtains the path to the key file via the MsiGetComponentPath API, also described below) and returns it to the operating system, which then executes that path at step 1410.

Turning to an explanation of how an application may interface with the managed software installer mechanism 84, FIGS. 15A-15B generally represent the steps taken by the application 98 and installer 84 (FIG. 11) to provide on-demand installation of features and components. First, at step 1500 of FIG. 15A, the application 98 determines that it needs a feature or component, (or at least state information regarding same). At step 1502, using the QueryFeatureState API, (described below), the application 98 requests the state of the feature or component from the installer. The state may be Absent, i.e., intentionally turned off by the user or administrator, and thus should not be installed by the application. Otherwise, the state may be Local (locally installed), Source (residing on a source media such as a network drive), or Advertised, (not installed but may be installed from the source when first needed). Based on the state, step 1506 determines whether the feature or component needs to be installed, i.e., it is not locally installed, but now it is needed and is proper for local installation. Step 1508 represents the installation on demand.

Step 1520 (FIG. 15B) is next executed, wherein the application 98 requests the installer 84 to verify that the needed files are present. To this end, the MsiUseFeature API is called. In general, the MsiUseFeature API does two things, i.e., verifies that the feature is intact, and increments the usage count (the usage count is the number of times that the user or application has used the feature). Note also that, if the feature is installed as run-from-source, (e.g., from the network or CD-ROM), part of the verification that the feature is intact involves finding a valid source. At step 1522, a verify status of valid or invalid is returned, whereby step 1524 branches to step 1526 to install needed files if the status is invalid. Note that until valid, step 1526 may keep returning to step 1520 to request verification, some number of times before failing (not shown). However, if the verification returns valid status, at steps 1528-1530, the application 98 requests and receives the path from the installer 84 and loads/executes it as appropriate.

In this manner, applications may repair themselves such as by installing missing or damaged components or files. Applications may avoid errors by checking with the installer 84 before making assumptions about what is installed on a machine at a given time. Missing features and components will be automatically installed by the installer mechanism whenever possible (and if allowed).

The Windows installer (MSI) APIs

The following describes some of the MSI APIs utilized for on-demand installation of software implementations, wherein the “%” symbol represents ANSI (A) and Unicode (W) versions.

MsiGetProductCode returns the product code for a registered component, i.e., this API returns information on the product that installed an application:

UINT WINAPI MsiGetProductCode%( LPCSTR% szComponent, // component ID registered for this product LPSTR% IpBuf39); //returned string GUID, sized for 39 characters

With the product code, the application may check its features, one by one, on an as needed basis, using MsiQueryFeatureState(ProductCode, FeatureID):

INSTALLSTATE WINAPI MsiQueryFeatureState%( LPCSTR% szProduct, LPCSTR% szFeature)

In this manner, an application may, for example, set itself to display appropriately available features and hide or otherwise indicate (e.g., visually gray out) those that are not available. To check features, the application calls MsiQueryFeatureState(ProductCode, FeatureID) using the product code returned in MsiGetProductCode() and the Feature ID of interest. As generally described above, if the return state is INSTALLSTATE_UNKNOWN or INSTALLSTATE_ABSENT, the feature is not available, and for example, should not be displayed in a user interface. For example, if the spellcheck feature is turned off by an administrator, it should not appear available to the user. Note that a feature that is absent is still technically available, although an application may choose to treat it as unavailable, as it implies that the user has indicated that the user wanted to make the feature go absent. However, if the return value is INSTALLSTATE_ADVERTISED, the feature has been advertised/published and is available. If the return value is INSTALLSTATE_SOURCE or INSTALLSTATE_LOCAL then the feature has been installed. Lastly, if the return value is INSTALLSTATE_SOURCEABSENT (the feature is installed to SOURCE, but the source is unavailable, e.g., the network is down). Note that MsiQueryFeatureState will not return this, only the “installed” state of the feature, however MsiUseFeature may return this state.

A management tool, for example, may enumerate the published features for a given product by calling MsiEnumFeatures:

UINT WINAPI MsiEnumFeatures %( LPCSTR% szProduct, DWORD iFeatureIndex, // zero based index into published features LPSTR% IpFeatureBuf, //feature name buffer, size = MAX_FEATURE_CHARS+1 LPSTR% IpParentBuf), // parent feature buffer, size = MAX_ FEATURE_CHARS+1

To request and install a feature, the following procedure may be used:

Call MsiUseFeature, passing in the ProductCode and FeatureId.

If the return code is INSTALLSTATE_LOCAL or INSTALLSTATE_SOURCE, proceed down the hierarchical “pyramid” of code.

If the return code is INSTALLSTATE_UNKNOWN or INSTALLSTATE_ABSENT, an error occurred, since MsiQueryFeatureState should first be called to ensure that only features known to be available are requested.

If the return code is INSTALLSTATE_ADVERTISED, call MsiConfigureFeature, passing in the ProductCode, FeatureId and INSTALLSTATE_DEFAULT.

The following are return states from MsiUseFeature:

INSTALLSTATE_UNKNOWN: the product/feature is not known

INSTALLSTATE_ABSENT: the feature is in the absent state

INSTALLSTATE_ADVERTISED: the feature is in the advertise state

INSTALLSTATE_SOURCE: the feature is install run-from-source and a valid source is available

INSTALLSTATE_SOURCEABSENT: the feature is install run-from-source and a valid source is not available

INSTALLSTATE_LOCAL: the feature is installed locally and the components that comprise the feature (and its parents) are all intact

INSTALLSTATE_BROKEN: the feature is installed locally and the components that comprise the feature (and its parents) are not all intact (one or more keyfiles are missing)

Note that the above algorithm is one possible way to treat the return values from MsiUseFeature, but not the only way. For example, (although not preferable) an application could choose not to use MsiQueryFeatureState, but could simply use the return value from MsiUseFeature to determine whether a feature was usable or not.

MsiUseFeature indicates an intent to use a product feature and increments the usage count therefor:

INSTALLSTATE WINAPI MsiUseFeature%( LPCSTR% szProduct, LPCSTR% szFeature)

MsiConfigureFeature forces the installed state for a product feature:

UINT WINAPI MsiConfigureFeature %( LPCSTR% szProduct, LPCSTR% szFeature, INSTALLSTATE eInstallState); //local / source / default / absent / lock / uncache

An alternative to MsiConfigureFeature is MsiConfigureFeatureFromDescriptor, useful for making templates, add-ins and Access wizards more resilient. MsiConfigureFeatureFromDescriptor is essentially the same as MsiConfigureFeature, but takes a descriptor (token) rather than separate product and feature parameters:

UINT WINAPI MsiConfigureFeatureFromDescriptor %( LPCSTR% szDescriptor, INSTALLSTATE eInstallState); //local / source / default / absent

Once an application has requested a feature, it may perform its usual operations such as loading DLLs, opening data files and so on. However, as long as the application first asks where the file is located, dynamically loading DLLs should not fail for DLLs that are the key file of a component. The general information for accessing a file is set forth below:

Call MsiGetComponentPath, passing in the component ID and other appropriate parameters.

If the return code is INSTALLSTATE_ABSENT, then MsiUseFeature/MsiConfigureFeature was not properly called.

If the return code is INSTALLSTATE_UNKNOWN, then the component is not installed/known.

If the return code is INSTALLSTATE_DEFAULT, then the call was successful. (see the return values for MsiGetComponentPath. We never return INSTALLSTATE_DEFAULT. INSTALLSTATE_LOCAL and INSTALLSTATE_SOURCE imply success).

If the return code is INSTALLSTATE_SOURCE_ABSENT (see above), then, for example, the network has gone down, or a CD-ROM is not loaded in the appropriate drive, whereby resiliency procedures should be invoked.

A fully qualified key file should be returned, and parsing may be needed such as if a file that is not the key file is desired.

In certain situations, i.e., when accessing a folder, a path is returned without a key file. Also, if the “key file” is a registry key or value then the registry key or value will be returned instead of a path to a file.

The following sets forth the return values for MsiGetComponentPath:

INSTALLSTATE_NOTUSED: The component being requested is disabled on the computer.

INSTALLSTATE_ABSENT: The component is not installed.

INSTALLSTATE_BAD_CONFIGURATION: The configuration data is corrupt.

INSTALLSTATE_INVALIDARG: One of the function parameters is invalid.

INSTALLSTATE_LOCAL: The component is installed locally.

INSTALLSTATE_SOURCE: The component is installed to run from source.

INSTALLSTATE_SOURCEABSENT: The component source is inaccessible.

INSTALLSTATE_UNKNOWN: The product code or component ID is unknown.

MsiGetComponentPath is a registry lookup that returns the full path to an installed component:

INSTALLSTATE WINAPI MsiGetComponentPath %( LPCSTR% szProduct, // product code for client product LPCSTR% szComponent, // component ID, string GUID LPSTR lpPathBuf, // returned path DWORD *pcchBuf) in / out buffer character count

A typical method is to call MsiGetComponentPath after performing the feature request steps set forth above. An alternative is to call MsiProvideComponent, which bundles three APIs (MsiUseFeature, MsiConfigureFeature, MsiGetComponentPath) into one. MsiProvideComponent returns the full component path, performing any necessary installation. As described with reference to FIG. 8, MsiProvideComponent and MsiProvideComponentFromDescriptor call MsiUseFeature to detect that components are installed, calls MsiConfigureFeature if any of its components are uninstalled, and then calls MsiGetComponentPath to obtain the path to its key file:

UINT WINAPI MsiProvideComponent %( LPCSTR% szProduct, // product code in case install required LPCSTR% szFeature, // feature ID in case install required LPCSTR% szComponent, // component ID DWORD dwReserved //reserved, must be zero LPSTR% lpPathBuf, // returned path, NULL if not desired DWORD *pcchBuf) in / out buffer character count

MsiProvideComponentFromDescriptor is essentially the same as MsiProvideComponent, but uses a descriptor instead of the product/feature/component identifiers:

UINT WINAPI MsiProvideComponentFromDescriptor %( LPCSTR% szDescriptor // product, feature, component information LPSTR% lpPathBuf, // returned path, NULL if not desired DWORD *pcchBuf) in / out buffer character count DWORD *pcchArgsOffset) returned offset of args in descriptor

This API, and MsiInstallMissingFile, below, are final, alternative attempts to fault in a feature, given a component or filename. It is expected that an application developer will attempt to use the other APIs to fault in features, but this may not always be possible. As a result, it is anticipated that such developers may benefit via these APIs.

To recover from a missing component error (following a call to MsiLocateComponent), a missing component may be reinstalled by MsiInstallMissingComponent, checking for a return code of ERROR_SUCCESS and then calling MsiLocateComponent again:

UINT WINAPI MsiInstallMissingComponent %( LPCSTR% szProduct, // product code LPCSTR% szComponent, // component ID, string GUID INSTALLSTATE eInstallState); //local / source / default / absent invalid

To recover from a missing file error (i.e., an application has failed in an attempt to open a file) the general procedure of calling MsiInstallMissingFile, checking for a return code of ERROR_SUCCESS and then re-trying the file I/O operation:

UINT WINAPI MsiInstallMissingFile %( LPCSTR% szProduct, // product code LPCSTR% szFile); // filename without path

As can be seen from the foregoing detailed description, there is provided a method and system for automatically deploying applications across a network in accordance with a policy. Via a script associated with a policy, and applied at user logon or machine connection to the network, applications may be assigned to policy recipients (users or machines), whereby the assigned applications are advertised to those policy recipients. Other applications may be published to users, whereby the application may be indirectly activated.

While the invention is susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and have been described above in detail. It should be understood, however, that there is no intention to limit the invention to the specific form or forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of the invention. 

What is claimed is:
 1. In a computer system, a method of installing a software implementation, comprising: receiving information initiated via the computer system corresponding to a software implementation that is needed to perform a requested operation, the information comprising at least one of the set of: application extension information associated with the software implementation, application category information, an application feature identifier, and an application component identifier; in response to receiving the information, determining that the software implementation is not installed on the computer system; and automatically installing the software implementation on the computer system to enable the requested operation to be performed based on the determination that the software implementation is not installed on the computer system.
 2. The method of claim 1 wherein determining from the information that the software implementation is not installed comprises accessing a database.
 3. The method of claim 2 wherein the database comprises a system registry.
 4. The method of claim 2, wherein automatically installing the software implementation further comprises modifying the database to indicate that the software implementation is installed.
 5. The method of claim 1 wherein the computer system is in a network of computers, and wherein automatically installing the software implementation comprises loading the software implementation on the computer system from a network source.
 6. The method of claim 1 wherein receiving information corresponding to a software implementation comprises receiving an application identifier associated with the software implementation.
 7. The method of claim 1 further comprising executing the installed software implementation and opening a file corresponding to the application extension information.
 8. The method of claim 1 wherein receiving information corresponding to a software implementation comprises receiving an object identifier.
 9. The method of claim 1 further comprising returning path information of the software implementation.
 10. The method of claim 9 wherein the software implementation information is received from an operating system, and wherein the path is returned to the operating system.
 11. The method of claim 9 wherein the software implementation information is received from an application program, and wherein the path is returned to the application program.
 12. The method of claim 1 further comprising advertising a software implementation to a policy recipient.
 13. The method of claim 1 wherein the computer system is connected to a network, and further comprising accessing a centralized store on the network to attempt to locate software implementation information.
 14. The method of claim 1 wherein the computer system receives the information initiated via the computer system independent of a connection to a network.
 15. In a computer system, a mechanism configured to provide a software implementation to a user, comprising, an interface configured to receive information initiated via the computer system corresponding to requests to use software implementations including a software implementation that is needed to perform a requested operation but is not installed on the computer system, the interface receiving the information initiated via the computer system independent of a connection to a network; a database describing an installed state of software implementations on the computer system; and an installer configured to query the database in response to each requested software implementation, to identify the installed state of the requested software implementation, and to automatically install the requested software implementation if the database indicates that the requested software implementation is not installed on the computer system.
 16. The mechanism of claim 15 wherein the installer comprises an install engine and an install service.
 17. The mechanism of claim 16 wherein the install engine runs with user privileges and the install service runs with elevated privileges.
 18. The mechanism of claim 15 wherein the computer system is in a network of computers, and further comprising a logon process, wherein the interface receives information corresponding to the installed state of the software implementation via the logon process.
 19. The mechanism of claim 15 wherein the interface receives the request to use the software implementation via an operating system.
 20. The mechanism of claim 15 wherein the interface receives the request to use the software implementation via an application.
 21. The mechanism of claim 15 wherein the software implementation corresponds to an application program.
 22. The mechanism of claim 15 wherein the software implementation corresponds to an object class.
 23. The mechanism of claim 15 wherein the software implementation corresponds to an application feature.
 24. The mechanism of claim 15 wherein the software implementation corresponds to an application component.
 25. The mechanism of claim 24 wherein the application component comprises a dynamic link library.
 26. The mechanism of claim 21 wherein the computer system is in a network of computers and wherein the installer installs the software implementation from a centralized store of information on the network.
 27. A computer-readable medium having computer-executable instructions, comprising: receiving information initiated at a computer system corresponding to a software implementation that is needed to perform a requested operation but not currently installed at the computer system; in response to receiving the information, determining that the software implementation is available to the computer system; and automatically installing the software implementation on the computer system to enable the requested operation to be performed.
 28. The computer-readable medium of claim 27 wherein the information initiated at a computer system is received independent of a connection to a network.
 29. A computer-readable medium having computer-executable instructions for performing the method of claim
 1. 30. In a computer system, a method of installing a software implementation, comprising: receiving information initiated via the computer system corresponding to a software implementation that is needed to perform a requested operation; in response to receiving the information, determining that the software implementation is not installed on the computer system; returning path information of the software implementation; and automatically installing the software implementation on the computer system to enable the requested operation to be performed based on the determination that the software implementation is not installed on the computer system.
 31. The method of claim 30 wherein the software implementation information is received from an operating system, and wherein the path is returned to the operating system.
 32. The method of claim 30 wherein the software implementation information is received from an application program, and wherein the path is returned to the application program.
 33. In a computer system in a network of computers, a mechanism configured to provide a software implementation to a user, comprising, an interface configured to receive information initiated via the computer system corresponding to requests to use software implementations including a software implementation that is needed to perform a requested operation but is not installed on the computer system; a database describing an installed state of software implementations on the computer system; a logon process configured to provide information corresponding to the installed state of the software implementation to the interface; and an installer configured to query the database in response to each requested software implementation, to identify the installed state of the requested software implementation, and to automatically install the requested software implementation if the database indicates that the requested software implementation is not installed on the computer system.
 34. In a computer system, a method of installing a software implementation, comprising: receiving, independent of a connection to a network, information initiated via the computer system corresponding to a software implementation that is needed to perform a requested operation; in response to receiving the information, determining that the software implementation is not installed on the computer system; and automatically installing the software implementation on the computer system to enable the requested operation to be performed based on the determination that the software implementation is not installed on the computer system.
 35. In a computer system, a mechanism configured to provide a software implementation, comprising, an interface configured to receive information initiated via the computer system corresponding to requests to use software implementations including a software implementation corresponding to an application feature that is needed to perform a requested operation but is not installed on the computer system; a database describing an installed state of software implementations on the computer system; and an installer configured to query the database in response to each requested software implementation, to identify the installed state of the requested software implementation, and to automatically install the requested software implementation if the database indicates that the requested software implementation is not installed on the computer system.
 36. In a computer system, a mechanism configured to provide a software implementation, comprising, an interface configured to receive information initiated via the computer system corresponding to requests to use software implementations including a software implementation corresponding to an application component that is needed to perform a requested operation but is not installed on the computer system; a database describing an installed state of software implementations on the computer system; and an installer configured to query the database in response to each requested software implementation, to identify the installed state of the requested software implementation, and to automatically install the requested software implementation if the database indicates that the requested software implementation is not installed on the computer system.
 37. The mechanism of claim 36 wherein the application component comprises a dynamic link library. 